package com.aaa.day1104.demo02;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * @author ${崔灿}
 * @date 2022/11/04 16:53
 **/

public class Test02 {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(55);
        list.add(47);
        list.add(63);
        list.add(2);
        list.add(9);
        //Comparator<Integer> comparator = (o1,o2)->{return Integer.compare(o1,o2);};
        Comparator<Integer> comparator =Integer::compare;

        Collections.sort(list, comparator);
        System.out.println(list);
    }
}
